//
// Created by 17775 on 2024/11/4.
//

#ifndef RAYCI_HISTOGRAMBASE_H
#define RAYCI_HISTOGRAMBASE_H

#include <QDockWidget>
#include "../qcustomplot.h"

QT_BEGIN_NAMESPACE
namespace Ui { class HistogramBase; }
QT_END_NAMESPACE

class HistogramBase : public QDockWidget {
Q_OBJECT

signals:
    void showHistogramSettings();

public:
    explicit HistogramBase(QWidget *parent = nullptr);
    ~HistogramBase() override;
    void setTitleName(const QString& titleName);
    QCustomPlot *getCustomPlot() {
        return customPlot;
    }
    QCPBars *getHistogram() {
        return histogram;
    }
    void setXRange(double x1, double x2);
    void setWidth(double width);
    void setDrag();

private:
    Ui::HistogramBase *ui;
    QCustomPlot *customPlot = nullptr;
    QCPBars *histogram = nullptr;
    QMenu *m_contextMenu = nullptr;
    QCPTextElement *title = nullptr;
};


#endif //RAYCI_HISTOGRAMBASE_H
